#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#include "hdfs.h"

// vtkTemporalStreamTracer
#ifndef __DCScheduler_h
#define  __DCScheduler_h

extern char *HOSTS[17];

extern char *FILES[17];

struct DCmonitor{
	int nr_hosts, nr_files, rep;
	char **host;
	char **file;
	int **map;
	//vector< set< int > > node_fragments_contained = vector< set< int > >( node_count);
	std::vector< std::set< int > > fragments_node_contained;
	std::vector< std::set< int > > node_fragments_contained;
};

struct DCscheduler{
	int nr_results;
	std::set< int > result;
	unsigned int current_hostid;
};

void DCscheduler_print();

int DCscheduler_getHostID(struct DCmonitor *p, char *host);

struct DCmonitor *DCmonitor_create(char *host[], char *file[], int rep);

struct DCscheduler *DCscheduler_create(struct DCmonitor *monitor, unsigned int current_hostid);

void DCscheduler_SimpleSchedule(struct DCscheduler *obj, struct DCmonitor *monitor);

int DCscheduler_check(struct DCscheduler *obj, int fileid);

void DCscheduler_showmap(struct DCmonitor *obj, char *files[]);

void DCscheduler_showresult(struct DCscheduler *scheduler);


void DCscheduler_destroy(struct DCscheduler *obj);

void DCmonitor_destroy(struct DCmonitor *obj);
#endif


/*
#ifndef __DCScheduler_h
#define __DCScheduler_h

extern char *HOSTS[17];

extern char *FILES[17];

struct DCscheduler{
	int nr_hosts, nr_files;
	char **host;
	char **file;
	unsigned char **map;
	unsigned char **result;
	unsigned int current_hostid;
};

extern int DCscheduler_getHostID(struct DCscheduler *p, char *host);

struct DCscheduler *DCscheduler_create(char *host[], char *file[], int current_hostid);

static int DCscheduler_computeFileScore(struct DCscheduler *obj, int fileid);

static int DCscheduler_pickfile(struct DCscheduler *obj);

void DCscheduler_visIOSchedule(struct DCscheduler *obj);

static int DCscheduler_computeHostScore(struct DCscheduler *obj, int hostid);

static int DCscheduler_pickhost(struct DCscheduler *obj, int fileid);

void DCscheduler_SimpleSchedule(struct DCscheduler *obj);

int DCscheduler_check(struct DCscheduler *obj, int fileid);

void DCscheduler_showmap(struct DCscheduler *obj);

void DCscheduler_showresult(struct DCscheduler *obj);

void DCscheduler_destroy(struct DCscheduler *obj);

extern void DCscheduler_print();

#endif
*/
